package job;

import java.io.File;

//单独一个小处理

public class Test {
    public static void main(String[] args) {
        String path = "D:\\table\\java\\Test_FileHandle\\新建文件夹";
        rename(path);
    }
    //单页处理
    public static void rename(String path){
        File file = new File(path);
        File[] files = file.listFiles();
        int i = 1;
        for (File file1 : files) {
            System.out.println(file1.getName());
            String name = path+"\\"+i+".jpg";
            file1.renameTo(new File(name));
            if(i == 1)
                i++;
            else
                i+=2;
        }
        System.out.println("执行完成");
    }
}
